home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / kaffe-0.2 / lib / net / java.net / java.net.SocketInputStream.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-12  |  895 b   |  33 lines

  1. /*
  2.  * java.net.SocketInputStream.c
  3.  *
  4.  * Copyright (c) 1996 Systems Architecture Research Centre,
  5.  *           City University, London, UK.
  6.  *
  7.  * See the file "license.terms" for information on usage and redistribution
  8.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  9.  *
  10.  * Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
  11.  */
  12.  
  13. #include <stdio.h>
  14. #include <native.h>
  15. #include "../../native/java.io/java.io.FileDescriptor.h"
  16. #include "../../native/java.io/java.io.FileInputStream.h"
  17. #include "java.net.SocketImpl.h"
  18. #include "java.net.SocketInputStream.h"
  19. #include "nets.h"
  20.  
  21. long
  22. java_net_SocketInputStream_socketRead(struct Hjava_net_SocketInputStream* this, HArray* buf, long offset, long len)
  23. {
  24.     int r;
  25.  
  26.     r = threadedRead(unhand(unhand(unhand(this)->impl)->fd)->fd, &buf->data[offset], len);
  27.     if (r < 0) {
  28.         SignalError(0, "java.io.IOException", SYS_ERROR);
  29.     }
  30.  
  31.     return (r);
  32. }
  33.